package com.hospital.common.core.module.entity.ecard;

import lombok.Data;

/**
 * @author lvyao
 * @description 远程地址调用
 * @date 2020/7/1
 */
@Data
public class RemoteUrl {


    private String ip;
    private String port;
    private String url = "/HC_PDE/services/healthCardService?wsdl";

    private String newIp;
    private String newPort;
    private String newUrl = "/nrhc/card/v2/getWorkKey";
    private String accessId;
    private String newRegisterUrl = "/nrhc/card/v2/register";
    private String newGetPerson = "/nrhc/card/v2/getPersonInfo";

    public String getUrl() {
        return String.format("http://%s:%s%s", ip, port, url);
    }

    public String getNewUrl(String type) {
        String newUrls= newGetPerson;
        if (type.equals("1")){
            newUrls = newRegisterUrl;
        }else if (type.equals("0")){
            newUrls = newUrl;
        }
        return String.format("http://%s:%s%s", newIp, newPort, newUrls);
    }

}
